//http://www.sencha.com/forum/showthread.php?77984-Field-help-text-plugin.
//usage:     plugins: [ new Ext.ux.FieldHelp('Some help text') ],
Ext.ux.FieldHelp = Ext.extend(Object, (function(){
    function syncInputSize(w, h) {
        this.el.setSize(w, h);
    }

    function afterFieldRender() {
        if (!this.wrap) {
            this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
            this.positionEl = this.resizeEl = this.wrap;
            this.actionMode = 'wrap';
            this.onResize = this.onResize.createSequence(syncInputSize);
        }
        this.wrap[this.helpAlign == 'top' ? 'insertFirst' : 'createChild']({
            cls: 'x-form-helptext',
            html: this.helpText
        });
    }

    return {
        constructor: function(t, align) {
            this.helpText = t;
            this.align = align;
        },
    
        init: function(f) {
            f.helpAlign = this.align;
            f.helpText = this.helpText;
            f.afterRender = f.afterRender.createSequence(afterFieldRender);
        }
    };
})());